Documentation for Users  1.3.1
Perception Toolbox for Virtual Reality (PTVR) Manual
Specifying 3D Orientation of objects



A visual object is not only defined by its position but also by its orientation.

Say we want to change the orientation of the green arrow shown in Figure 1. For instance, we want to rotate the green arrow about the Y axis.

Can you visualize what this rotation will look like?

Figure 1: What is the effect of rotating the green arrow say about the Y axis ?


To apply a rotation to this object, we need three parameters:

  • the pivot of the object
  • the vector corresponding to the axis of rotation (here the Y axis)
  • the sign of the rotation
😉 Remark: if not specified otherwise, the axes correspond to the GLOBAL coordinate system

The first two parameters are simple to visualize.




The sign of the rotation is however a trickier parameter.

You have to look at the Y axis from the tip of its axis (as in Figure 2) and you need to remember that the PTVR coordinate system is a left-handed system (see here).

Figure 2: Looking at an axis from its tip.

In a left-handed system (hence in PTVR) ...

  • if you apply an increasing change of orientation about the Y axis to the green arrow object, the arrow will rotate clockwise (see Figure 3).
  • if you apply a decreasing change of orientation about the Y axis to the green arrow object, the arrow will rotate CounterClockwise (see Figure 4).


Figure 3: increasing orientation -> Clockwise (when seen from the tip of the axis).

Figure 4: decreasing orientation -> CounterClockwise (when seen from the tip of the axis).


By comparison, in a right-handed system (not shown) ...

  • if you apply an increasing change of orientation about the Y axis to the green arrow object, the arrow will rotate Counterclockwise.
  • if you apply a decreasing change of orientation about the Y axis to the green arrow object, the arrow will rotate Clockwise.

Sequence of rotations

In the examples above a single rotation was applied (here about the Y axis). In many cases, you might want to apply successively (the order matters) 3 rotations about the 3 axes to reach the final orientation you wish. These cases will be explained in the Manual for users with concrete examples.

Links

Wikipedia contributors, 'Orientation (geometry)', Wikipedia, The Free Encyclopedia, 11 March 2022, 09:11 UTC, https://en.wikipedia.org/w/index.php?title=Orientation_(geometry)&oldid=1076477808 [accessed 5 May 2022]

Excerpts

Section Mathematical representations -> 3D >In general the position and orientation in space of a rigid body are defined as the position and orientation (relative to the main reference frame) of another reference frame, which is fixed relative to the body, and hence translates and rotates with it (the body's local reference frame, or local coordinate system).
>At least three independent values are needed to describe the orientation of this local frame.
>Three other values describe the position of a point on the object. ...